<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8"%>
<%@ page import="com.biz.utils.ConfigUtil" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	String resoursUrl = ConfigUtil.get("RESOURCES_URL");
%>

<!doctype html>
<html class="no-js" >
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>我的申请</title>
	<meta name="description" content="">
	<meta name="keywords" content="">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	<meta name="renderer" content="webkit">
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<meta name="format-detection" content="telephone=no" />
	<jsp:include page="/jsp/inc.jsp"></jsp:include>
	<style>
		.ywc_plus{
			font-size: 0.32rem;
			color:#ff6666;
		}
		.ywc_no{
			font-size: 0.28rem;
			color:#a3a3a3;
		}
	</style>
</head>
<body>
<div class="m-tab demo-small-pitch myacttab" data-ydui-tab>
	<ul class="tab-nav">
		<li class="tab-nav-item tab-active"><a href="javascript:;">进行中（<span id="jxzHd">0</span>）</a></li>
		<li class="tab-nav-item"><a href="javascript:;">已完成（<span id="ywcHd">0</span>）</a></li>
	</ul>
	<div class="tab-panel">
		<div class="tab-panel-item tab-active">
			<ul class="myactlist">
				<c:choose>
					<c:when test="${not empty actlist}">
						<c:forEach items="${actlist}"  var="obj" varStatus="vs">
							<c:if test="${obj.activityState == 1}">
								<c:if test="${obj.approvState == 0}">
									<li onclick="toDetail('${obj.activityId}');">
										<div class="title">${obj.activityName}</div>
										<div class="timeandchecking">
											<div class="fl-l time">${obj.createTime}</div>
											<div class="fl-r"><sapn class="checkresultspan onchecking">审核中</sapn></div>
											<br class="clear"/>
										</div>
									</li>
								</c:if>
								<c:if test="${obj.approvState == 1}">
									<li onclick="toDetail('${obj.activityId}');">
										<div class="title">${obj.activityName}</div>
										<div class="timeandchecking">
											<div class="fl-l time">${obj.createTime}</div>
											<div class="fl-r"><sapn class="checkresultspan checkingok">报名成功</sapn></div>
											<br class="clear"/>
										</div>
									</li>
								</c:if>
								<c:if test="${obj.approvState == 2}">
									<li onclick="toDetail('${obj.activityId}');">
										<div class="title">${obj.activityName}</div>
										<div class="timeandchecking">
											<div class="fl-l time">${obj.createTime}</div>
											<div class="fl-r"><sapn class="checkresultspan checkingfalse">审核失败</sapn></div>
											<br class="clear"/>
										</div>
										<div class="falsereason">${obj.appNotes}</div>
									</li>
								</c:if>
							</c:if>
						</c:forEach>
					</c:when>
					<c:otherwise>
						<div class="notxt">
							<img src="<%=basePath%>resources/image/icon-nullnull.png" alt="" class="notxtImg">
							<div class="nultxttip">暂无记录</div>
						</div>
					</c:otherwise>
				</c:choose>
			</ul>
		</div>
		<div class="tab-panel-item">
			<ul class="myactlist">
				<c:choose>
					<c:when test="${not empty actlist}">
						<c:forEach items="${actlist}"  var="obj" varStatus="vs">
							<c:if test="${obj.activityState == 3}">
								<li onclick="toDetail('${obj.activityId}');">
									<div class="title">${obj.activityName}</div>
									<div class="timeandchecking">
										<div class="fl-l time">${obj.createTime}</div>
										<c:if test="${obj.ispresent == 0}">
											<div class="fl-r"><sapn class="ywc_plus">+${obj.integral}</sapn></div>
										</c:if>
										<c:if test="${obj.ispresent == 1}">
											<div class="fl-r"><sapn class="ywc_no">未到场</sapn></div>
										</c:if>
										<br class="clear"/>
									</div>
								</li>
							</c:if>
						</c:forEach>
					</c:when>
					<c:otherwise>
						<div class="notxt">
							<img src="<%=basePath%>resources/image/icon-nullnull.png" alt="" class="notxtImg">
							<div class="nultxttip">暂无记录</div>
						</div>
					</c:otherwise>
				</c:choose>
			</ul>
		</div>
	</div>
</div>
<script>
    loadCount();


	function loadCount()
	{
		$.ajax({
			url:'${pageContext.request.contextPath}/userCenter/loadCount.ac',
			type:'post',
			dataType:'json',
			success:function(data){
				$("#jxzHd").html(data.ingCount);
                $("#ywcHd").html(data.endCount);
			}
		});
	}

    /**
	 * 跳转详情
     * @param id
     */
	function toDetail(id){
        window.location.href="${pageContext.request.contextPath}/mebactivity/toMebactivityDetail.ac?id="+id;
	}

</script>
</body>
</html>
